-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raise_on_encrypted: true #177
Conversation
@boazsegev any feedback on these changes? |
Sorry, busy days... I'll look it over soon... I hope. |
This PR is great! 👏 On the other hand, there are some things I've been wondering about in the PR.
|
I've never used
It's still related to the PR since when I went to run specs, there was no way to run all of them. Thought it would be best to make it a default rake task like other projects.
Thanks for the feedback / looking at it! |
@boazsegev just checking in on this. It look good? |
@boazsegev @leviwilson that would be a great feature. |
@boazsegev Do you mind to take a look on this feature to at least allow user to stop proceeding until a better decryption is implemented? There is no way user can stop proceeding encrypted pdf without able to ingest flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work. I apologize for the (extremely) belated response.
I would rather avoid the catch-and-release for the Zlib::DataError
exception unless it is always true that the exception is caused by an encryption error (and I think it could be caused by a PDF object compression error as well)...
Is it possible to remove this before a merge?
Thanks!
Thank you every one for the work you put in on this :) I'll test and push the patch as soon as I have a moment. |
released @ 1.0.23 |
This pull request adds a
raise_on_encrypted: true
option toCombinePDF.load
. In this manner, a consumer can choose to haveCombinePDF
throw an exception in the event that the PDF they are trying to open is encrypted.In addition to this, sometimes during the
CombinePDF::PDFParser#parse
, it can come across a scenario where it raises aZlib::DataError
but was still able to obtain some information about the file in theroot_object
such as whether or not there isroot_object[:Encrypt]
information in it. For those conditions, rather than raising aZlib::DataError
it will raise theCombinePDF::EncryptionError
instead but only if theraise_on_encrypted: true
has been set. Otherwise, it'll allow theZlib::DataError
to bubble up.